Electronic apparatus and method for controlling electronic apparatus thereof

ABSTRACT

Provided herein are an electronic apparatus and a method for controlling thereof. The method for controlling an electronic apparatus may include: acquiring a voice command, performing voice recognition of the voice command and acquiring a first text, identifying a prestored indexed word among a plurality of words included in the first text, identifying a rule template among a plurality of prestored rule templates including the indexed word and slots matched to at least one word excluding the indexed word among the plurality of words, and acquiring a control command corresponding to the voice command based on the identified rule template.

TECHNICAL FIELD

The disclosure relates to an electronic apparatus and a method forcontrolling thereof, and for example, to an electronic apparatus thatidentifies a rule template corresponding to a user's voice command amonga plurality of prestored rule templates, and a method for controllingthereof.

CROSS-REFERENCE TO RELATED APPLICATION

This application is based on and claims priority under 35 U.S.C. § 119to Korean Patent Application No. 10-2020-0116934, filed on Sep. 11,2020, in the Korean Intellectual Property Office, the disclosure ofwhich is incorporated by reference herein in its entirety.

BACKGROUND ART

Recently, the amount of information that exists online and offline isincreasing exponentially, and with the development of electroniccommunication technologies, a user can acquire desired information atanytime, anywhere through an electronic apparatus.

In this regard, recently, in order for an electronic apparatus toappropriately perform an operation desired by a user, a command responsesystem that generates a control command corresponding to a user commandis being used widely.

Also, recently, an artificial intelligence system implementingartificial intelligence of a human level is being used in variousfields, and in various systems within an artificial intelligence system,a command response system is being utilized.

Meanwhile, a conventional command response system may be implemented asa voice assistant based on a server using a deep learning orstatistics-based technology, and thus the system needs hardware of ahigh specification.

Accordingly, there is a rising need for implementing a command responsesystem in an on-device environment of a low specification.

DISCLOSURE Technical Problem

Embodiments of the disclosure provide an electronic apparatus thatprovides a rule template corresponding to a voice command by identifyinga word indexed in a text included in a user's voice command, and amethod for controlling thereof.

Technical Solution

An electronic apparatus according to an example embodiment of thedisclosure includes: a memory storing at least one command, and aprocessor connected with the memory and configured to control theelectronic apparatus, wherein the processor is configured, by executingthe at least one command, to control the electronic apparatus to:acquire a voice command; perform voice recognition of the voice commandand acquire a first text; identify an indexed word prestored in thememory from among a plurality of words included in the first text;identify a rule template among a plurality of rule templates prestoredin the memory including the indexed word and slots matched to at leastone word excluding the indexed word among the plurality of words; andacquire a control command corresponding to the voice command based onthe identified rule template.

A method for controlling an electronic apparatus according to an exampleembodiment of the disclosure comprises: acquiring a voice command;performing voice recognition of the voice command and acquiring a firsttext; identifying a prestored indexed word among a plurality of wordsincluded in the first text; identifying a rule template among aplurality of prestored rule templates including the indexed word andslots matched to at least one word excluding the indexed word among theplurality of words; and acquiring a control command corresponding to thevoice command based on the identified rule template.

Advantageous Effects

According to the disclosure, by identifying an indexed word in a textincluded in a user's voice command, a rule template corresponding to theuser's voice command can be effectively identified in prestored ruletemplates.

DESCRIPTION OF DRAWINGS

The above and other aspects, features and advantages of certainembodiments of the present disclosure will be more apparent from thefollowing detailed description, taken in conjunction with theaccompanying drawings, in which:

FIG. 1 is a block diagram illustrating an example operation of anelectronic apparatus according to various embodiments;

FIG. 2 is a block diagram illustrating an example configuration of anelectronic apparatus according to various embodiments;

FIG. 3 is a diagram illustrating an example method of performingindexing for a rule template according to various embodiments;

FIG. 4A is a diagram illustrating an example method of identifying arule template corresponding to a user's voice command according tovarious embodiments;

FIG. 4B is a diagram illustrating an example in which a user's voicecommand is English according to various embodiments;

FIG. 5 is a flowchart illustrating an example operation of determiningranks according to various embodiments;

FIG. 6 is a block diagram illustrating example components for providinga control command and a response for a user's voice command according tovarious embodiments;

FIG. 7 is a flowchart illustrating an example method for controlling anelectronic apparatus according to various embodiments; and

FIG. 8 is a block diagram illustrating an example configuration of anelectronic apparatus according to various embodiments.

BEST MODE

Hereinafter, the disclosure will be described in greater detail withreference to the accompanying drawings.

FIG. 1 is a block diagram illustrating an example operation of anelectronic apparatus 200 according to various embodiments.

The electronic apparatus 200 (refer to FIG. 2) may include a commandresponse system 100 for performing an operation corresponding to auser's voice command, when a user's voice command is received.

The command response system 100 may analyze a user's voice command suchas identifying an indexed word included in the voice command throughnatural processing, and identify a rule template corresponding to theuser's voice command. An indexed word may refer, for example, to a wordstored in an inverted index database (DB) 20, and a word stored in theinverted index DB 20 may be stored together with the identificationnumber of a rule template including the word and location information ofthe word in the rule template, and a more detailed description of suchcontent will be described in greater detail below with reference to FIG.3.

The electronic apparatus 200 may acquire a control command correspondingto the voice command based on the identified rule template, and performan operation corresponding to the control command.

For performing the aforementioned operations, the command responsesystem 100 may include an automatic speech recognition (ASR) module(e.g., including various processing circuitry and/or executable programelements) 110, a natural language understanding (NLU) module (e.g.,including various processing circuitry and/or executable programelements) 120, and a control command generation module (e.g., includingvarious processing circuitry and/or executable program elements) 130,etc. However, the disclosure is not limited thereto, and the commandresponse system 100 may additionally include necessary componentsdepending on cases.

The electronic apparatus 200 may further include other systems (e.g., adialogue system) other than the command response system 100, and a moredetailed description of such content will be described in greater detailbelow with reference to FIG. 6.

The automatic speech recognition (ASR) module 110 may include variousprocessing circuitry and/or executable program elements and convert auser voice command received from the electronic apparatus 200 into textdata.

For example, the automatic speech recognition module 110 may includeutterance recognition. The utterance recognition may include an acousticmodel and a language model. For example, the acoustic model may includeinformation related to vocalization, and the language model may includeunit phoneme information and information on a combination of unitphoneme information. The utterance recognition may convert a userutterance into text data using the information related to vocalizationand the information on the unit phoneme information. The information onthe acoustic model and the language model may be stored, for example, inan automatic speech recognition database (ASR DB) (not shown).

The natural language understanding module 120 may include variousprocessing circuitry and/or executable program elements and performsemantic analysis and identify the intent of a user's voice command. Forexample, the natural language understanding module 120 according to thedisclosure may perform semantic analysis using a rule-matching method,and provide a rule template corresponding to a user's voice command.

The natural language understanding module 120 may compare a plurality ofrespective rule templates including intents and slots necessary foridentifying intents with text data corresponding to a user's voicecommand, and identify the intent of the voice command.

A slot may include information for identifying an intent of a user in arule template as a parameter necessary for expressing an intent of arule template. A slot may include an open slot and a close slot. A closeslot may refer, for example, to a slot wherein words that can be matchedin the slot are limited. For example, a close slot may be generated bydesignating the type of the close slot as ‘a singer,’ and limiting wordscorresponding to ‘a singer.’ In this example, if words corresponding to‘a singer’ limited in the close slot are included in a user's voicecommand, the electronic apparatus 200 may identify that the text ismatched to the close slot. For example, in case a close slot is includedin a rule template, the electronic apparatus 200 may identify that therule template is a rule template corresponding to a user's voice commandonly if words of the type corresponding to the close slot are includedin the words included in the user's voice command.

An open slot may refer, for example, to a slot wherein words that can bematched in the slot are not limited, unlike a close slot. For example,if <SearchTerm> is designated as an open slot, all words included in auser's voice command can be matched in the open slot. Then, throughwords matched to <SearchTerm>, search may be performed.

The natural language understanding module 120 may include a sentenceanalysis module (e.g., including various processing circuitry and/orexecutable program elements) 1000, an indexing identification module(e.g., including various processing circuitry and/or executable programelements) 2000, a rule template identification module (e.g., includingvarious processing circuitry and/or executable program elements) 3000,and a rank determination module (e.g., including various processingcircuitry and/or executable program elements) 4000.

The sentence analysis module 1000 may include various processingcircuitry and/or executable program elements for acquiring a first textby identifying words included in a user's voice command through textdata acquired through the automatic speech recognition module 110.

As an example, if a user's voice command is “Send a message to my eldestson to call me,” the sentence analysis module 1000 may analyze text dataacquired through the voice command, and identify an example textincluding five words like “[(to) my eldest son] [call me] [(to)] [amessage] [send]).”

As an example, the sentence analysis module 1000 may acquire a wordwhich is a generalized form of a verb included in a user's voicecommand. For example, the sentence analysis module 1000 may generalizethe verb “send” included in “Send a message to my eldest son to call me”and acquire a word “send.”

As an example, the sentence analysis module 1000 may identify apostposition included in a user's voice command and extend thepostposition. That is, the sentence analysis module 1000 may extend thepostposition included in “to my eldest son” included in “Send a messageto my eldest son to call me” to “for,” “toward,” etc., and store thephrase as [to my eldest son], [toward my eldest son], and [for my eldestson]. Also, the sentence analysis module 1000 may extend thepostposition included in “to” to “for,” etc., and store the phrase to[to] and [for].

When a first text is acquired through the sentence analysis module 1000,an indexed word may be identified through the indexing identificationmodule 2000.

The indexing identification module 2000 may include various processingcircuitry and/or executable program elements for identifying an indexedword included in a user's voice command.

As an example, a plurality of rule templates may be prestored in a ruletemplate DB 10 for performing a control command corresponding to a uservoice command. In the plurality of respective rule templates included inthe rule template DB, indexing may be performed for words excludingslots.

Indexing according to the disclosure may refer, for example, toidentifying identification numbers of rule templates including at leastone word included in the plurality of respective rule templates and thelocations of the words in the rule templates, and information whereinthe identification numbers of the rule templates including theidentified words and the locations of the words in the rule templatesare indexed may be prestored in an inverted index DB 20.

For example, if an example rule template is “<SearchTerm> to<MessageText> a message to,” the electronic apparatus 200 may identifythat the words excluding the slots <SearchTerm> and <MessageText> in theexample rule template are [a message] and [send].

In each of the identified indexing words, indexing information such as(x,y) may be prestored in the inverted index DB 20. In (x,y), x mayrefer, for example, to an identification number of a rule template, andy may indicate the location of the word in the rule template. Forexample, if x is 1, and y is 0, it may indicate that the word isincluded in a rule template having a first identification number, andthe word is located in the first location in the rule template.

For example, if an example rule template has the first identificationnumber, [a message] is located in the third location in the example ruletemplate, and thus the electronic apparatus 200 may index [a message]for the example rule template as (1,2). Then, the electronic apparatus200 may index [send] as (1,3). A detailed description regardingperforming indexing in a rule template will be described in greaterdetail below with reference to FIG. 3.

The indexing identification module 2000 may include various processingcircuitry and/or executable program elements and identify indexed wordsamong words included in the first text. The indexing identificationmodule 2000 may identify the locations of the indexed words in the firsttext.

For example, the indexing identification module 2000 may identify [amessage] and [send] for which indexing was performed in the example text“[(to) my eldest son] [call me] [(to)] [a message] [send]).” Theindexing identification module 2000 may identify that [a message] islocated in the fourth location, and [send] is located in the fifthlocation in the example text.

When the indexed words in the first text are identified through theindexing identification module 2000, rule templates corresponding to auser's voice command may be identified through the rule templateidentification module 3000.

The rule template identification module 3000 may include variousprocessing circuitry and/or executable program elements for identifyingat least one rule template corresponding to a user's voice command amonga plurality of prestored rule templates.

The rule template identification module 3000 may identify at least onefirst rule template which may include indexed words identified throughthe indexing identification module 2000, and which corresponds to thelocations of the identified indexed words among a plurality of prestoredrule templates.

For example, in the example text, [a message] and [send] arecontinuously located as the forth location and the fifth location, andin the example rule template, [a message] and [send] are alsocontinuously located as the third location and the fourth location.Accordingly, the rule template identification module 3000 may identifythe example rule template as a rule template which includes the indexedwords included in the example text, and which corresponds to thelocations of the indexed words. Other than the example rule template,the rule template identification module 3000 may identify at least onefirst rule template wherein [a message] and [send] are continuouslylocated among the plurality of rule templates prestored in the ruletemplate DB 10.

The rule template identification module 3000 may identify at least onesecond rule template of which slots are matched by at least one wordexcluding the indexed words among the plurality of words included in thefirst text in the identified at least one first rule template.

For example, the rule template identification module 3000 may identifywhether the <SearchTerm> and <MessageText> slots in the example ruletemplate “<SearchTerm> to <MessageText> send a message to” are matchedby the words “[(to) my eldest son] [call me] [(to)]” excluding theindexed words in the example text “[(to) my eldest son] [call me] [(to)][a message] [send]).” As an example, to the <SearchTerm> slot, [(to) myeldest son] may be matched, and to the <MessageText> slot, [call me][(to)] may be matched, and thus the rule template identification module3000 may identify the example rule template as the second rule template.Other than the example rule template, the rule template identificationmodule 3000 may identify at least one second template of which slots arematched by the words “[(to) my eldest son] [call me] [(to)]” among theplurality of rule templates prestored in the rule template DB 10.

When at least one second rule template is identified, the rankdetermination module 4000 may identify the priorities of the respectiveat least one second rule template, and identify a rule templateaccording to the user's voice command.

The rank determination module 4000 may include various processingcircuitry and/or executable program elements for identifying thepriorities of the plurality of respective rule templates identifiedthrough the rule template identification module 3000. The electronicapparatus 200 may identify a rule template having the highest priorityamong the plurality of rule templates identified through the ruletemplate identification module 3000 as a rule template corresponding toa user's voice command.

As an example, if a plurality of second rule templates are identifiedthrough the rule template identification module 3000, the rankdetermination module 4000 may identify at least one rule template havingthe biggest numbers of words and slots among the plurality of secondrule templates as a 2-1 rule template having the highest priority.

In case the number of the identified 2-1 rule template is one, the rankdetermination module 4000 may identify the one 2-1 rule template as arule template corresponding to a user's voice command.

In case the number of the identified 2-1 rule templates is a pluralnumber, the rank determination module 4000 may identify the ruletemplate of which number of slots is the smallest among the 2-1 ruletemplates as a 2-2 rule template. In case the number of the 2-2 ruletemplate is one, the rank determination module 4000 may identify the one2-2 rule template as a rule template corresponding to a user's command.An example in which there are a plurality of 2-2 rule templates will bedescribed in greater detail below with reference to FIG. 5.

When a rule template corresponding to a user's voice command isidentified through the rank determination module 4000, the electronicapparatus 200 may generate a control command corresponding to the ruletemplate through the control command generation module 130.

The control command generation module 130 may include various processingcircuitry and/or executable program elements for providing a controlcommand corresponding to a voice command using a rule templatecorresponding to a user's voice command. For example, the controlcommand generation module 130 may acquire a control command for a usercommand based on an intent and slots included in a rule templatecorresponding to a user's voice command identified through the naturallanguage understanding module 120.

According to the disclosure, the plurality of respective rule templatesprestored in the rule template DB 10 may include slots, and they mayinclude an intent for performing a control command according to a ruletemplate. The control command generation module 130 may acquire acontrol command based on an intent corresponding to a rule templatecorresponding to a voice command identified through the natural languageunderstanding module 120 among the plurality of rule templates prestoredin the rule template DB 10, and slots included in the rule template.

For example, if it is identified that a rule template corresponding tothe example text “[(to) my eldest son] [call me] [(to)] [a message][send])” is “<SearchTerm> to <MessageText> send a message to” throughthe natural language understanding module 120, the control commandgeneration module 130 may identify that the rule template includes anintent of “sending a message,” and a message is sent to a subjectsearched by the <SearchTerm> slot, and words included in the<MessageText> slot are a content of sending a message. That is, thecontrol command generation module 130 may match the <SearchTerm> slotwith “[(to) my eldest son],” and search the eldest son in the addresslist in the electronic apparatus 200, and match the <MessageText> slotwith “[call me] [(to)],” and send a message to “call me” to the cellphone of the eldest son identified as a result of search.

In the aforementioned example, it was explained that a user's voicecommand is acquired, and a control command corresponding to the voicecommand is generated. However, the disclosure is not limited thereto,and the electronic apparatus 200 may directly acquire a text including auser command without going through the automatic speech recognitionmodule 110, and generate a control command.

FIG. 2 is a block diagram illustrating an example configuration of anelectronic apparatus according to various embodiments.

As illustrated in FIG. 2, the electronic apparatus 200 may include amemory 210 and a processor (e.g., including processing circuitry) 220.However, the components of the electronic apparatus 200 are not limitedto the aforementioned components, and some components can obviously beadded or omitted according to the type of the electronic apparatus.

The memory 210 may store at least one instruction or data related to atleast one other component of the electronic apparatus 200. For example,the memory 210 may be implemented as a non-volatile memory, a volatilememory, a flash-memory, a hard disk drive (HDD) or a solid state drive(SSD), etc. Also, the memory 210 may be accessed by the processor 220,and reading/recording/correcting/deleting/updating, etc. of data by theprocessor 220 may be performed.

In the disclosure, the term memory may include a memory 210, a ROM (notshown), and a RAM (not shown) inside the processor 220, or a memory card(not shown) installed on the electronic apparatus 200 (e.g., a micro SDcard, a memory stick). In the memory 210, programs or data, etc. fordisplaying various kinds of screens to be displayed in the display areaof the display may be stored.

As described above, the memory 210 may store at least one instruction.An instruction may be for controlling the electronic apparatus 200. Forexample, in the memory 210, an instruction related to an application forimplementing the command response system 100 may be stored.

The memory 210 may include a plurality of components of the commandresponse system 100 as illustrated in FIG. 1. In particular, the memory210 may include a rule template DB and an inverted index DB.

In addition, the memory 210 may store an artificial intelligence agentfor providing a response to a user's command. For example, theelectronic apparatus 200 may use an artificial intelligence agent forgenerating a control command and a response for a user's voice command.The artificial intelligence agent may refer, for example, to a dedicatedprogram for providing artificial intelligence (AI)-based services (e.g.,a voice recognition service, an agent service, a translation service, asearch service, etc.). For example, the artificial intelligence agentmay be executed by a conventional generic-purpose processor (e.g., aCPU) or a separate. AI-dedicated processor (e.g., a GPU, etc.). Adetailed description regarding an artificial intelligence agent will bedescribed in greater detail below with reference to FIG. 6.

The processor 220 may be electronically connected with the memory 210and may include various processing circuitry to control the overalloperations and functions of the electronic apparatus 200. The processor220 may control the overall operations of the electronic apparatus 200.For this, the processor 220 may include, for example, and withoutlimitation, one or more of a central processing unit (CPU), anapplication processor (AP), a communication processor (CP) a dedicatedprocessor, or the like. The processor 220 may be implemented in variousways. For example, the processor 220 may be implemented, for example,and without limitation, as at least one of an application specificintegrated circuit (ASIC), an embedded processor, a microprocessor, ahardware control logic, a hardware finite state machine (FSM), a digitalsignal processor (DSP), or the like. In the disclosure, the termprocessor 220 may include a central processing unit (CPU), a graphicprocessing unit (GPU), and a main processing unit (MPU), etc.

The processor 220 may control hardware or software components connectedto the processor 220 by operating an operating system or an applicationprogram, and perform various kinds of data processing and operations.The processor 220 may load instructions or data received from at leastone of other components on a volatile memory and process them, and storevarious data in a non-volatile memory.

The processor 220 may be electronically connected with the memory 210and control the overall operations and functions of the electronicapparatus 200. For example, by executing at least one instruction storedin the memory 210, the processor 220 may provide the command responsesystem 100 described above through FIG. 1. For example, the processor220 may acquire a user voice command, perform voice recognition of theuser voice command and acquire a first text, identify indexed wordsprestored in the memory among a plurality of words included in the firsttext, identify a rule template which includes the indexed words andincludes slots matched to at least one word excluding the indexed wordsamong the plurality of words among a plurality of rule templatesprestored in the memory, and acquire a control command corresponding tothe voice command based on the identified rule template.

As an example, the automatic speech recognition module 110, the naturallanguage understanding module 120, and the control command generationmodule 130 in FIG. 1 may be included in the processor 220 in theelectronic apparatus 200. The natural language understanding module 120may be implemented through the sentence analysis module 1000, theindexing identification module 2000, the rule template identificationmodule 3000, and the rank determination module 4000.

A plurality of modules for implementing the command response system 100may be included in the electronic apparatus 200, but this is merely anexample, and at least some of the modules for implementing the commandresponse system 100 may be included in an external server.

The plurality of modules 110, 120 and 130 may respectively beimplemented as software, but the disclosure is not limited thereto, andsome of them may be implemented as a combination of hardware andsoftware (e.g., various circuitry and exectable program elements). Asanother example, the plurality of modules may be implemented as onesoftware.

As described above, the plurality of modules 110, 120.130 may be locatedin the processor 120, but the disclosure is not limited thereto, and theplurality of modules 110, 120 130 may be located in the memory 210. Incase the plurality of modules 110, 120 130 are located in the memory210, the processor 220 may load the plurality of modules 110, 120 130from the non-volatile memory to the volatile memory, and execute eachfunction of the plurality of modules 110, 120 130. Loading may refer,for example, to an operation of calling the data stored in thenon-volatile memory to the volatile memory and storing the data, so thatthe processor 220 can access the data.

FIG. 3 is a diagram illustrating an example method of performingindexing for a rule template according to various embodiments.

According to the disclosure, for the plurality of respective ruletemplates included in the rule template DB 10, indexing may beperformed.

Referring to FIG. 3, the electronic apparatus 200 may identify slotsincluded in the plurality of respective rule templates 300 prestored inthe rule template DB 10 and words excluding the slots through a ruletemplate analysis module 5000, and acquire a plurality of parsed ruletemplates 310. The electronic apparatus 200 may perform indexing for theplurality of parsed rule templates 310, and store the indexinginformation in the inverted index DB 20.

The rule template analysis module 5000 may include various processingcircuitry and/or executable program elements for indexing, in therespective words excluding slots included in the rule templates,identification numbers of the rule templates including the words and thelocations of the words in the rule templates.

In FIG. 3, it is illustrated that indexing of a 3-1 rule template 300-1to a 3-4 rule template 300-4 is performed through the rule templateanalysis module 5000. In FIG. 3, only the 3-1 rule template 300-1 to the3-4 rule template 300-4 are illustrated, but the disclosure is notlimited thereto, and indexing may be performed for all rule templatesincluded in the rule template DB 10.

The 3-1 rule template 300-1 may be a rule template having the firstidentification number, and the 3-2 rule template 300-2 may be a ruletemplate having the second identification number. Also, the 3-3 ruletemplate 300-3 and the 3-4 rule template 300-4 may be rule templateshaving the third identification number and the fourth identificationnumber, and the identification numbers may be preset by a rule managerdrafting rule templates.

For example, the rule template analysis module 5000 may identify slots,postpositions, and words excluding the slots for the respective ruletemplates included in the plurality of rule templates 300, and acquire aplurality of parsed rule templates 310. The rule template analysismodule 5000 may store the plurality of parsed rule templates 310 in therule template DB 10.

For example, the rule template analysis module 5000 may identify theopen slots of <SearchTerm> and <MessageText> in the 3-1 rule template300-1 which is “<SearchTerm> to <MessageText> send a message to,” andidentify (to) and (to) as postpositions. Then, the rule templateanalysis module 5000 may identify [a message] and [send] as wordsexcluding the slots, and acquire a parsed 3-1 rule template 310-1 whichis “<SearchTerm>(to)<MessageText>(to) [a message] [send].”

The electronic apparatus 200 may perform indexing such as (x,y) for therespective words excluding the slots in the plurality of parsed ruletemplates 310. In (x,y), x may refer, for example, to an identificationnumber of a rule template, and y may refer, for example, to the locationof the word in the rule template. For example, if x is 1, and y is 0, itmay indicate that the word is located in the first location in theexample rule template.

For example, the parsed 3-1 rule template 310-1 has the firstidentification number, and [a message] and [send] are respectivelylocated in the third location and the fourth location based on the wordsegments in the parsed 3-1 rule template 310-1. Accordingly, theelectronic apparatus 200 may index [a message] in the parsed 3-1 ruletemplate 310-1 as (1,2), and [send] as (1,3).

The parsed 3-2 rule template 310-2 has the second identification number,and [a message] and [send] are respectively located in the firstlocation and the second location based on the word segments in theparsed 3-2 rule template 310-2. Accordingly, the electronic apparatus200 may index [a message] in the parsed 3-2 rule template 310-2 as(2,0), and [send] as (2,1).

The parsed 3-3 rule template 310-3 has the third identification number,and [a message] and [send] are respectively located in the secondlocation and the third location based on the word segments in the parsed3-3 rule template 310-3. Accordingly, the electronic apparatus 200 mayindex [a message] in the parsed 3-3 rule template 310-3 as (3,1), and[send] as (3,2).

The parsed 3-4 rule template 310-4 has the fourth identification number,and [a message] and [send] are respectively located in the firstlocation and the third location based on the word segments in the parsed3-4 rule template 310-4. Accordingly, the electronic apparatus 200 mayindex [a message] in the parsed 3-4 rule template 310-4 as (4,0), and[send] as (4,2).

The electronic apparatus 200 may store the indexed information in theplurality of parsed rule templates 310 in the inverted index DB 20.

When a user voice command is acquired, the electronic apparatus 200 mayidentify the words indexed through the process in FIG. 3 in the uservoice command through the inverted index DB 20. Then, the electronicapparatus 200 may identify a rule template which includes the indexedwords included in the user voice command, and includes slots matched toat least one word excluding the indexed words among the plurality ofwords included in the user voice command in the rule template DB 10. Adetailed description in this regard will be provided in greater detailbelow with reference to FIG. 4A and FIG. 4B.

FIG. 4A is a diagram illustrating an example method of identifying arule template corresponding to a user's voice command according tovarious embodiments.

According to the disclosure, if a user's voice command is received, theelectronic apparatus 200 may acquire text data 400 corresponding to theuser's voice command. For example, the electronic apparatus 200 mayconvert a user's voice command into text data 400 through the automaticspeech recognition (ASR) module 110.

The sentence analysis module 1000 may convert the text data 400 into afirst text 410. For example, the sentence analysis module 1000 mayanalyze the text data 400 which is “Send a message to my eldest son tocall me,” and identify an example text including five words like “[(to)my eldest son] [call me] [(to)] [a message] [send]).”

As an example, the sentence analysis module 1000 may acquire a wordwhich is a generalized form of a verb included in the first text 410.For example, the sentence analysis module 1000 may generalize the verb“send” included in “Send a message to my eldest son to call me” andacquire a word “send.”

As an example, the sentence analysis module 1000 may identify apostposition included in a user's voice command and extend thepostposition. That is, the sentence analysis module 1000 may extend thepostposition “to” included in “to my eldest son” included in “Send amessage to my eldest son to call me” to “for,” “toward,” etc., and storethe phrase as [to my eldest son], [toward my eldest son], and [for myeldest son]. Also, the sentence analysis module 1000 may extend thepostposition “to” included in “to” to “for,” etc., and store the phraseto [to] and [for].

The electronic apparatus 200 may identify indexed words in the firsttext 410, and identify the locations of the indexed words in the firsttext 410. As described in FIG. 3, indexing was previously performed for[a message] and [send], and thus the electronic apparatus 200 mayidentify the words [a message] and [send] as the indexed words. Then,the electronic apparatus 200 may identify that [a message] is located inthe fourth location, and [send] is located in the fifth location in thefirst text 410.

The electronic apparatus 200 may identify rule templates which includethe indexed words, and which are matched to the locations of the indexedwords through the inverted index DB 20. In the inverted index DB 20 inFIG. 4A, all the rule templates having the first to fourthidentification numbers include the words [a message] and [send], but inthe parsed rule template having the fourth identification number 310-4,the words [a message] and [send] are not continuously located.Accordingly, the electronic apparatus 200 may identify the parsed ruletemplates having the first to third identification numbers 310-1 to310-3 as rule templates which include the indexed words, and which arematched to the locations of the indexed words.

The electronic apparatus 200 may identify whether the slots in the ruletemplates 310-1 to 310-3 identified through the inverted index DB 20 arematched to at least one word excluding the indexed words among theplurality of words included in the first text in the rule template DB10.

For example, the electronic apparatus 200 may identify whether the slotsin the rule templates having the first to third identification numbers310-1 to 310-3 are matched through the words [(to) my eldest son], [callme], and [(to)] excluding the indexed words among the plurality of wordsincluded in the first text.

In the parsed 3-1 rule template 310-1, the <SearchTerm> and<MessageText> slots are located in front of the indexed word [amessage]. Thus, [(to) my eldest son], [call me], and [(to)] may bematched to the <SearchTerm> and <MessageText> slots.

In the parsed 3-3 rule template 310-3, the <SearchTerm> slot is locatedin front of [a message]. Thus, [(to) my eldest son], [call me], and[(to)] may be matched to the <SearchTerm> slot.

In the parsed 3-2 rule template 310-2, the <SearchTerm> and<MessageText> slots are located behind the indexed word [send]. Thus,the words [(to) my eldest son], [call me], and [(to)] may not be matchedby the slots of the parsed 3-2 rule template 310-2.

Accordingly, the electronic apparatus 200 may identify the 3-1 ruletemplate 300-1 and the 3-3 rule template 300-3 corresponding to theparsed 3-1 rule template 310-1 and the parsed 3-3 rule template 310-3 asrule templates corresponding to the user's voice command.

FIG. 4B is a diagram illustrating an example in which a user's voicecommand is English according to various embodiments.

According to the disclosure, if a user's English voice command isreceived, the electronic apparatus 200 may acquire English text data 500corresponding to the user's voice command. For example, the electronicapparatus 200 may convert the user's voice command into English textdata 500 through the automatic speech recognition (ASR) module 110.

Then, the sentence analysis module 1000 may convert the English textdata 500 into a first text 510. For example, the sentence analysismodule 1000 may analyze the English text data 500 which is “SENDINGMESSAGE MY SON TO CALL ME,” and identify an example text including sixwords like “[SEND] [MESSAGE] [MY] [SON] [(TO) CALL] [ME].”

As an example, the sentence analysis module 1000 may acquire a wordwhich is a generalized form of the verb included in the first text 510.That is, the sentence analysis module 1000 may generalize “SENDING”included in “SENDING MESSAGE MY SON TO CALL ME” and acquire the word“SEND.”

As an example, the sentence analysis module 1000 may identify apostposition included in a user's voice command and extend or omit thepostposition. That is, the sentence analysis module 1000 may extend “TO”included in “TO CALL” included in “SENDING MESSAGE MY SON TO CALL ME” to“FOR,” or omit the postposition, and store the phrase as [TO CALL], [FORCALL], and [CALL].

The electronic apparatus 200 may identify the indexed words in the firsttext 510, and identify the locations of the indexed words in the firsttext 510. As an example, in case indexing was previously performed for[MESSAGE] and [SEND], the electronic apparatus 200 may identify thewords [MESSAGE] and [SEND] as indexed words in the first text 510. Theelectronic apparatus 200 may identify that [SEND] is located in thefirst location, and [MESSAGE] is located in the second location in thefirst text 510.

Through the inverted index DB 25, the electronic apparatus 200 mayidentify rule templates which include the indexed words, and which arematched to the locations of the indexed words. As an example, theinverted index DB 20 in FIG. 4A may include information on indexingperformed for Korean words, and the inverted index DB 25 in FIG. 4B mayinclude information on indexing performed for English words. However,the disclosure is not limited thereto, and in one inverted index DB,information on indexing performed for various languages may be stored.

In the inverted index DB 25 of FIG. 4B, all rule templates having thefirst to fourth identification numbers include the words [MESSAGE] and[SEND], but in the parsed rule template 510-4 having the fourthidentification number, the words [MESSAGE] and [SEND] are notcontinuously located as in the example text. Thus, the electronicapparatus 200 may identify the parsed rule templates 510-1 to 510-3having the first to third identification numbers as rule templates whichinclude the indexed words, and which are matched to the locations of theindexed words.

The electronic apparatus 200 may identify whether the slots in the ruletemplates 510-1 to 510-3 identified through the inverted index DB 25 inthe rule template DB 15 are matched to at least one word excluding theindexed words among the plurality of words included in the first text.As an example, in the rule template DB 10 in FIG. 3 and FIG. 4A, Koreanrule templates may be stored, and in the rule template DB 15 in FIG. 4B,English rule templates may be stored. However, the disclosure is notlimited thereto, and in one rule template DB, rule templates in variouslanguages may be stored.

Through the words [MY] [SON] [(TO) CALL] [ME] excluding the indexedwords among the plurality of words included in the first text, theelectronic apparatus 200 may identify whether the slots in the ruletemplates 510-1 to 510-3 having the first to third identificationnumbers are matched.

In the parsed rule template 510-1 having the first identificationnumber, the <SearchTerm> and <MessageText> slots are located behind theindexed word [MESSAGE], and thus the words [MY] [SON] [(TO) CALL] [ME]may be matched to the <SearchTerm> and <MessageText> slots.

In the parsed rule template 510-3 having the third identificationnumber, the <SearchTerm> slot is located in front of [MESSAGE], and thusthe words [MY] [SON] [(TO) CALL] [ME] may be matched to the <SearchTerm>slot.

In the parsed rule template 510-2 having the second identificationnumber, the <SearchTerm> slot is located behind [MESSAGE], but the<MessageText> slot is located in front of [SEND], and thus the words[MY] [SON] [(TO) CALL] [ME] may be matched by the <SearchTerm> slot inthe parsed rule template 510-2 having the second identification number,but the words may not be matched by the <MessageText> slot.

Accordingly, the electronic apparatus 200 may identify rule templatescorresponding to the parsed rule template 510-1 having the firstidentification number and the parsed rule template 510-3 having thethird identification number as rule templates corresponding to theuser's voice command.

In FIG. 3, FIG. 4A, and FIG. 4B, it is illustrated that the slots in therule templates are only open slots, but the disclosure is not limitedthereto, and the rule templates may include close slots. For example, incase rule templates corresponding to a user's voice command includeclose slots, words of the type corresponding to the close slots may beincluded in the first text. In case rule templates corresponding to auser's voice command include open slots, the open slots may be matchedthrough words excluding the indexed words in the first text.

According to the disclosure, as in FIG. 4A and FIG. 4B, a plurality ofrule templates corresponding to a user's voice command may beidentified. In this case, the priorities of the plurality of respectiveidentified rule templates may be identified, and a rule template havingthe highest priority may be identified as the final rule template. Amethod for identifying priorities will be described in greater detailbelow with reference to FIG. 5.

FIG. 5 is a flowchart illustrating an example operation of determiningranks according to various embodiments.

The electronic apparatus 200 may identify a plurality of rule templatesthrough the rule template identification module 3000 in operation S505.For example, through the rule template identification module 3000, theelectronic apparatus 200 may identify a plurality of rule templateswhich include indexed words included in a user's voice command, andwhich include slots matched by at least one word excluding the indexedwords among a plurality of words included in the user's voice commandamong the rule templates prestored in the rule template DB 10. Forexample, as described above in FIG. 1, the electronic apparatus 200 mayidentify a plurality of second rule templates through the rule templateidentification module 3000.

When the plurality of rule templates are identified, the electronicapparatus 200 may identify a 2-1 rule template having the biggest (e.g.,largest) numbers of slots and words among the plurality of ruletemplates in operation S510. For example, a rule template having bigger(e.g., larger) numbers of slots and words among the plurality of ruletemplates may be a rule template reflecting an intent for the user'svoice command more correctly.

In case the number of the identified 2-1 rule template is one inoperation S515-Y, the electronic apparatus 200 may identify the one 2-1rule template as the final rule template. Taking the case of FIG. 4A asan example, between the 3-1 rule template 300-1 and the 3-3 ruletemplate 300-3 identified as rule templates corresponding to a user'svoice command, the numbers of slots and words of the 3-1 rule template300-1 are bigger than those of the 3-3 rule template 300-3, and thus theelectronic apparatus 200 may identify the 3-1 rule template as the finalrule template.

In case the number of the plurality of identified 2-1 rule templates isnot one in operation S515-N, the electronic apparatus 200 may identify a2-2 rule template having the smallest (e.g., lowest) number of slotsamong the plurality of 2-1 rule templates in operation S520. Forexample, the plurality of respective 2-1 rule templates have the samesummed-up number of slots and words, and as the number of slots issmaller (e.g., lower) in the summed-up number, it indicates that thenumber of words is bigger. Also, among the plurality of rule templateshaving the same summed-up number of slots and words, a rule templatehaving a bigger number of words may be a rule template reflecting anintent for the user's voice command more correctly.

In case the number of the identified 2-2 rule template is one inoperation S525-Y, the electronic apparatus 200 may identify the one 2-2rule template as the final rule template.

In case the number of the plurality of identified 2-2 rule templates isnot one in operation S525-N, the electronic apparatus 200 may identify a2-3 rule template having the smallest number of open slots among theplurality of 2-2 rule templates in operation S530. For example, theplurality of 2-2 rule templates are rule templates that have the samesummed-up number of slots and words, and have the same number of slots,and as the number of open slots is smaller in the number of slots, itmay mean that the number of close slots is bigger. Accordingly, amongthe plurality of 2-2 rule templates, a rule template having a biggernumber of close slots may be a rule template reflecting an intent forthe user's voice command more correctly.

In case the number of the identified 2-3 rule template is one inoperation S535-Y, the electronic apparatus 200 may identify the one 2-3rule template as the final rule template.

In case the number of the plurality of identified 2-3 rule templates isnot one in operation S535-N, the electronic apparatus 200 may identify a2-4 rule template having the biggest number of slots to which apostposition is matched among the plurality of 2-3 rule templates inoperation S540. For example, among the plurality of 2-3 rule templates,a rule template having a bigger number of slots to which a postpositionis matched may be a rule template reflecting an intent for the user'svoice command more correctly.

In case the number of the identified 2-4 rule template is one inoperation S545-Y, the electronic apparatus 200 may identify the one 2-4rule template as the final rule template.

In case the number of the plurality of identified 2-4 rule templates isnot one in operation S545-N, the electronic apparatus 200 may identify arule template having the earliest identification number among theplurality of 2-4 rule templates as the final rule template. For example,to a rule template having an earlier identification number of a ruletemplate preset by a rule manager who drafts rule templates, the higherpriority may have been designated by the rule manager.

FIG. 6 is a block diagram illustrating example components for providinga control command and a response for a user's voice command according tovarious embodiments.

According to the disclosure, the electronic apparatus 200 may acquire acontrol command according to a user's voice command, and perform anoperation corresponding to the control command. As a method foracquiring a control command, e.g., the ASR module 610, the naturallanguage understanding module 620, and the control command generationmodule 630 were described above through FIG. 1, overlapping explanationmay not be repeated here.

The electronic apparatus 200 may provide a dialogue system whichperforms an operation corresponding to a control command, and whichprovides a response to a user's voice command. For example, a dialoguemanager DM (e.g., including various processing circuitry and/orexecutable program elements) 640 may acquire information on a responsefor a user's voice command based on a rule template acquired by thenatural language understanding module 620. The dialogue manager 640 mayprovide a response for the user voice command based on a knowledge DB.The knowledge DB may be included in the electronic apparatus 200, butthis is merely an embodiment, and the knowledge DB may be included in anexternal server.

When the information on a response for the user voice command isacquired, a natural language generation (NLG) module (e.g., includingvarious processing circuitry and/or executable program elements) 650 maychange the response information acquired through the dialogue manager640 to the form of a text. The information changed to the form of a textmay be in the form of a natural language utterance. The responseinformation may be, for example, information guiding completion of anoperation corresponding to the user voice command. The informationchanged to the form of a text may be displayed on the display of theelectronic apparatus 200, or it may be changed to the form of a voice bya text-to-speech (TTS) module (e.g., including various processingcircuitry and/or executable program elements) 660.

The TTS module 660 may change the information in the form of a text toinformation in the form of a voice. The TTS module 660 may include aplurality of TTS models for generating responses in various voices, andthe TTS module 660 may acquire a response voice in the form of a voiceusing a TTS model corresponding to a user among the plurality of TTSmodels. For example, if it is determined that a user is a child, the TTSmodule 660 may acquire a response voice using a TTS model correspondingto a child (e.g., a TTS model for generating a voice of an animationcharacter that children like).

For example, if a user's voice command which is “Send a message to myeldest son to call me” is acquired, the natural language understandingmodule 620 may identify a rule template which is “<SearchTerm> to<MessageText> send a message to” as a rule template corresponding to theuser's voice command, according to an embodiment of the disclosure. Thecontrol command generation module 630 may acquire a control commandbased on the identified rule template, and the electronic apparatus 200may perform an operation corresponding to the control command.

The dialogue manager 640 may generate information that “A message askingto call was sent to your eldest son” as information guiding completionof the operation corresponding to the user voice command, and providethe information in the form of a text by the natural language generation(NLG) module 650, or provide the information in the form of a voicethrough the TTS module 660.

As an example, before the electronic apparatus 200 performs an operationcorresponding to a control command, the dialogue manager 640 maygenerate information asking whether to perform the control command andprovide the information. For example, the dialogue manager 640 maygenerate information which is “Do you want me to send a message askingto call to your eldest son?” and provide the information in the form ofa text through the natural language generation (NLG) module 650, orprovide the information in the form of a voice through the TTS module660, and according to a user voice command in response thereto, theelectronic apparatus 200 may perform an operation corresponding to thecontrol command.

As an example, in case a rule template corresponding to a user's voicecommand was not identified through the natural language understandingmodule 620, the dialogue manager 640 may generate information asking foran additional input. That is, the dialogue manager 640 may generateinformation such as “Please repeat that” and “I didn't understand,” andprovide the information in the form of a text by the natural languagegeneration (NLG) module 650, or provide the information in the form of avoice through the TTS module 660.

As an example, in case a rule template corresponding to a user's voicecommand was identified through the natural language understanding module620, but it is not perfect for performing an operation according to therule template, the dialogue manager 640 may generate information askingfor an additional input.

For example, if a rule template corresponding to a user's voice commandwhich is “Send a message to my eldest son to call me” is identified as“<SearchTerm> to send a message” through the natural languageunderstanding module 620, the dialogue manager 640 may generateinformation such as “What kind of message do you want me to send to youreldest son?” and provide the information in the form of a text by thenatural language generation (NLG) module 650, or provide the informationin the form of a voice through the TTS module 660. Then, when the user'sadditional input is acquired, the electronic apparatus 200 may send atext corresponding to the additional input as a message to the subjectidentified through the <SearchTerm>.

FIG. 7 is a flowchart illustrating an example method for controlling anelectronic apparatus according to various embodiments.

The electronic apparatus 200 may acquire a user voice command inoperation S710. As an example, the electronic apparatus 200 may acquirea user voice command through a microphone provided on the electronicapparatus 200.

The electronic apparatus 200 may perform voice recognition of the voicecommand and acquire a first text in operation S720. As an example, theelectronic apparatus 200 may acquire a first text by converting thevoice command into text data through the ASR module, and converting theconverted text data into a first text through the sentence analysismodule.

The electronic apparatus 200 may identify prestored indexed words amonga plurality of words included in the first text. For example, in therespective words excluding the slots in the plurality of rule templatesstored in the rule template DB 10, identification numbers of ruletemplates including the words and the locations of the words in the ruletemplates may be indexed. Then, the electronic apparatus 200 mayidentify words for which indexing was performed in the first text, andidentify the locations of the identified words in the first text.

The electronic apparatus 200 may identify, among the plurality ofprestored rule templates, a rule template which includes the indexedwords and includes slots matched to at least one word excluding theindexed words among the plurality of words in operation S740. Forexample, the electronic apparatus 200 may identify at least one firstrule template which includes the indexed words, and which corresponds tothe locations of the indexed words among the plurality of rule templatesprestored in the rule template DB 10, and identify at least one secondrule template of which slots are matched by the at least one wordexcluding the indexed words among the plurality of words included in thefirst text in the identified at least one first rule template.

As an example, if it is identified that there are a plurality of secondrule templates, the electronic apparatus 200 may identify the prioritiesof the plurality of respective second rule templates, and identify afinal rule template corresponding to a voice command based on theidentified priorities. For example, the electronic apparatus 200 mayidentify a rule template having the biggest numbers of texts and slotsamong the plurality of second rule templates as a rule templatecorresponding to a user voice command.

In case there is one rule template having the biggest numbers of textsand slots, the electronic apparatus 200 may identify the rule templateas the final rule template.

In case there are a plurality of rule templates having the biggestnumbers of texts and slots, the electronic apparatus 200 may identify arule template having the smallest number of slots among the ruletemplates as a rule template corresponding to the user voice command. Incase there is one rule template having the smallest number of slots, theelectronic apparatus 200 may identify the rule template as the finalrule template.

The electronic apparatus 200 may acquire a control command correspondingto the voice command based on the identified rule template in operationS750.

FIG. 8 is a block diagram illustrating an example configuration of anelectronic apparatus according to various embodiments. Referring to FIG.8, the electronic apparatus 800 may include a memory 810, a processor(e.g., including processing circuitry) 820, a microphone 830, a display840, a communicator (e.g., including communication circuitry) 850, and aspeaker 860. As the memory 810 and the processor 820 illustrated in FIG.8 overlap with the memory 210 and the processor 220 illustrated in FIG.2, overlapping explanation may not be repeated here. Also, depending onimplementation examples of the electronic apparatus 800, some of thecomponents in FIG. 8 may be removed, or other components can be added.

The microphone 830 may receive an input of an audio signal including auser voice command. The microphone 830 may receive an audio signalincluding a user voice command for making the electronic apparatus 800perform a specific control command. A plurality of microphones 830 maybe provided on the main body of the electronic apparatus 800, but thisis merely an embodiment, and the microphone 830 may be located outsideand may be electronically connected with the electronic apparatus 800.

The display 840 may refer to a component for the electronic apparatus800 to visually provide information. The electronic apparatus 800 mayinclude at least one display 840, and may display a response for aninput user voice command, an inquiry regarding a user voice command,notification information, etc. through the display 840. The display 840may be implemented, for example, and without limitation, as a liquidcrystal display (LCD), a plasma display panel (PDP), organic lightemitting diodes (OLED), transparent OLED (TOLED), micro LED, etc. Also,the display 840 may be implemented in the form of a touch screen thatcan detect a user's touch operation, and it may also be implemented as aflexible display that can be folded or bent.

For example, the display 840 may visually provide a response for a uservoice command.

The communicator 850 may include various communication circuitry thatcan perform communication with an external device. Connection ofcommunication of the communicator 850 with an external device mayinclude communication via a third device (e.g., a repeater, a hub, anaccess point, a server, or a gateway, etc.). Wireless communication mayinclude, for example, cellular communication using at least one of LTE,LTE Advance (LTE-A), code division multiple access (CDMA), wideband CDMA(WCDMA), a universal mobile telecommunications system (UMTS), WirelessBroadband (WiBro), or a Global System for Mobile Communications (GSM).According to an embodiment, wireless communication may include, forexample, at least one of wireless fidelity (WiFi), Bluetooth, Bluetoothlow energy (BLE), Zigbee, near field communication (NFC), MagneticSecure Transmission, radio frequency (RF), or a body area network (BAN).Wired communication may include, for example, at least one of auniversal serial bus (USB), a high definition multimedia interface(HDMI), a recommended standard 232 (RS-232), power line communication,or a plain old telephone service (POTS). Networks wherein wirelesscommunication or wired communication is performed may include atelecommunication network, for example, at least one of a computernetwork (e.g.: an LAN or a WAN), the Internet, or a telephone network.

For example, the communicator 850 may perform communication with anexternal server and provide a command response system and a dialoguesystem services.

The speaker 860 may refer to a component for the electronic apparatus800 to acoustically provide information. The electronic apparatus 800may include at least one speaker 860, and output a response for an inputuser voice command, an inquiry regarding a user voice command,notification information, etc. as an audio signal through the speaker860. A component for outputting an audio signal may be implemented asthe speaker 860, but this is merely an embodiment, and the component canobviously be implemented as an output terminal.

Various modifications may be made to the embodiments of the disclosure,and there may be various types of embodiments. Accordingly, variousexample embodiments were illustrated in drawings, and the embodimentswere described in detail in the detailed description. However, it shouldbe noted that the various example embodiments are not for limiting thescope of the disclosure to a specific embodiment, but they should beinterpreted to include various modifications, equivalents, and/oralternatives of the embodiments of the disclosure. With respect to thedetailed description of the drawings, similar components may bedesignated by similar reference numerals.

In describing the disclosure, in case it was determined that detailedexplanation of related known functions or features may unnecessarilyconfuse the gist of the disclosure, the detailed explanation may havebeen omitted.

In addition, the embodiments described above may be modified in variousdifferent forms, and the scope of the technical idea of the disclosureis not limited to the embodiments above. Rather, these embodiments wereprovided to make the disclosure more sufficient and complete, and tofully convey the technical idea of the disclosure to those skilled inthe art.

The terms used in the disclosure were used simply to explain variousembodiments, and were not intended to limit the scope of the disclosure.Further, singular expressions include plural expressions, unless definedobviously differently in the context.

In addition, in the disclosure, expressions such as “have,” “may have,”“include,” and “may include” denote the existence of suchcharacteristics (e.g.: elements such as numbers, functions, operations,and components), and do not exclude the existence of additionalcharacteristics.

Also, in the disclosure, the expressions “A or B,” “at least one of Aand/or B,” or “one or more of A and/or B” and the like may include allpossible combinations of the listed items. For example, “A or B,” “atleast one of A and B,” or “at least one of A or B” may refer to all ofthe following cases: (1) including at least one A, (2) including atleast one B, or (3) including at least one A and at least one B.

In addition, the expressions “first,” “second” and the like used in thedisclosure may describe various elements regardless of any order and/ordegree of importance. Such expressions may be used to distinguish oneelement from another element, and are not intended to limit theelements.

The description in the disclosure that one element (e.g.: a firstelement) is “(operatively or communicatively) coupled with/to” or“connected to” another element (e.g.: a second element) should beinterpreted to include both the case where the one element is directlycoupled to the another element, and the case where the one element iscoupled to the another element through still another element (e.g.: athird element).

The description that one element (e.g.: a first element) is “directlycoupled” or “directly connected” to another element (e.g.: a secondelement) can be interpreted to mean that still another element (e.g.: athird element) does not exist between the one element and the anotherelement.

The expression “configured to” used in the disclosure may beinterchangeably used with other expressions such as “suitable for,”“having the capacity to,” “designed to,” “adapted to,” “made to” and“capable of,” depending on cases. Meanwhile, the term “configured to”does not necessarily refer to a device that is “specifically designedto” in terms of hardware.

Instead, under some circumstances, the expression “a device configuredto” may refer, for example, to the device being “capable of” performingan operation together with another device or component. For example, thephrase “a processor configured to perform A, B, and C” may mean adedicated processor (e.g.: an embedded processor) for performing thecorresponding operations, or a generic-purpose processor (e.g.: a CPU oran application processor) that can perform the corresponding operationsby executing one or more software programs stored in a memory device.

Further, in the embodiments of the disclosure, ‘a module’ or ‘a unit’may perform at least one function or operation, and may be implementedas hardware or software, or as a combination of hardware and software.Also, a plurality of ‘modules’ or ‘units’ may be integrated into atleast one module and implemented as at least one processor, excluding ‘amodule’ or ‘a unit’ that needs to be implemented as specific hardware.

Various elements and areas in the drawings are illustratedschematically. Accordingly, the technical idea of the disclosure is notlimited by the relative sizes or intervals illustrated in theaccompanying drawings.

The aforementioned various embodiments of the disclosure may beimplemented in a recording medium that can be read by a computer or adevice similar to a computer using software, hardware or a combinationthereof. According to implementation by hardware, the embodimentsdescribed in the disclosure may be implemented using at least one ofapplication specific integrated circuits (ASICs), digital signalprocessors (DSPs), digital signal processing devices (DSPDs),programmable logic devices (PLDs), field programmable gate arrays(FPGAs), processors, controllers, micro-controllers, microprocessors, oran electronic unit for performing various functions. In some cases, theembodiments described in this specification may be implemented as theprocessor itself. According to implementation by software, theembodiments such as procedures and functions described in thisspecification may be implemented as separate software modules. Each ofthe software modules may perform one or more functions and operationsdescribed in this specification.

The methods according to the aforementioned various embodiments of thedisclosure may be stored in a non-transitory readable medium. Such anon-transitory readable medium may be used while being installed onvarious devices.

A non-transitory readable medium may refer, for example, to a mediumthat stores data semi-permanently, and is readable by machines. Forexample, programs for executing the aforementioned various methods maybe provided while being stored in a non-transitory readable medium suchas a CD, a DVD, a hard disk, a blue-ray disk, a USB, a memory card, aROM and the like.

The methods according to the various embodiments described in thedisclosure may be provided while being included in a computer programproduct. The computer program product can be traded between a seller anda purchaser as a commodity. The computer program product may bedistributed in the form of a machine-readable storage medium (e.g.: acompact disc read only memory (CD-ROM)), or distributed online throughan application store (e.g.: PLAYSTORE™). In the case of onlinedistribution, at least a portion of the computer program product may beat least temporarily stored in a storage medium such as a server of amanufacturer, a server of an application store, or a memory of a relayserver, or temporarily generated.

While the disclosure has been illustrated and described with referenceto various example embodiments, it will be understood that the variousexample embodiments are intended to be illustrative, not limiting. Itwill be further understood by those skilled in the art that variousmodifications may be made without departing from the true spirit andfull scope of the disclosure, including the appended claims.

1. An electronic apparatus comprising: a memory storing at least onecommand; and a processor connected with the memory and configured, byexecuting the at least one instruction, to control the electronicapparatus, wherein the processor is configured to: acquire a voicecommand, perform voice recognition of the voice command and acquire afirst text, identify an indexed word prestored in the memory among aplurality of words included in the first text, identify a rule templateamong a plurality of rule templates prestored in the memory, includingthe indexed word and slots matched to at least one word excluding theindexed word among the plurality of words, and acquire a control commandcorresponding to the voice command based on the identified ruletemplate.
 2. The electronic apparatus of claim 1, wherein the processoris configured to: identify a plurality of rule templates among theplurality of prestored rule templates, identify the priorities of theplurality of respective rule templates, and based on the identifiedpriorities, identify a final rule template corresponding to the voicecommand.
 3. The electronic apparatus of claim 1, wherein the processoris configured to: convert the voice command into text data through anautomatic speech recognition (ASR) module, and convert the convertedtext data into a first text through a sentence analysis module.
 4. Theelectronic apparatus of claim 1, wherein, in the respective wordsexcluding the slots in the plurality of rule templates, identificationnumbers of the rule templates including the words and locations of thewords in the rule templates are indexed, and the processor is configuredto: identify a word for which indexing was performed in the first text,and identify the location of the identified word in the first text. 5.The electronic apparatus of claim 4, wherein the processor is configuredto: identify at least one first rule template which includes the indexedword, and which corresponds to the location of the identified indexedword among the plurality of prestored rule templates, and identify atleast one second rule template in which slots are matched by the atleast one word excluding the indexed word among the plurality of wordsincluded in the first text in the identified at least one first ruletemplate.
 6. The electronic apparatus of claim 2, wherein the processoris configured to: identify a rule template wherein the numbers of thewords and the slots are the largest among the plurality of ruletemplates as the rule template corresponding to the voice command. 7.The electronic apparatus of claim 6, wherein the processor is configuredto: based on the number of the identified rule templates being plural,identify a rule template wherein a number of the slots is the smallestamong the identified rule templates as the rule template correspondingto the voice command.
 8. The electronic apparatus of claim 1, whereinthe processor is configured to: acquire the first text by extendingpostpositions included in the voice command and performinggeneralization for the words included in the voice command.
 9. Theelectronic apparatus of claim 1, wherein, based on a close slot beingincluded in the identified template, a word of a type corresponding tothe close slot is included in the first text.
 10. The electronicapparatus of claim 1, wherein, based on an open slot being included inthe identified template, the open slot is matched through wordsexcluding the indexed word in the first text.
 11. A method forcontrolling an electronic apparatus, the method comprising: acquiring avoice command; performing voice recognition of the voice command andacquiring a first text; identifying a prestored indexed word among aplurality of words included in the first text; among a plurality ofprestored rule templates, identifying a rule template including theindexed word and slots matched to at least one word excluding theindexed word among the plurality of words; and acquiring a controlcommand corresponding to the voice command based on the identified ruletemplate.
 12. The method of claim 11, wherein the identifying a ruletemplate further comprises: among the plurality of prestored ruletemplates, identifying a plurality of rule templates including theindexed word and slots matched to at least one word excluding theindexed word among the plurality of words; identifying the priorities ofthe plurality of respective rule templates; and based on the identifiedpriorities, identifying a final rule template corresponding to the voicecommand.
 13. The method of claim 11, wherein the acquiring comprises:converting the voice command into text data through an automatic speechrecognition (ASR) module; and converting the converted text data into afirst text through a sentence analysis module.
 14. The method of claim11, wherein, in the respective words excluding the slots in theplurality of rule templates, identification numbers of the ruletemplates including the words and locations of the words in the ruletemplates are indexed, and the identifying the word comprises:identifying a word for which indexing was performed in the first text,and identifying the location of the identified word in the first text.15. The method of claim 14, wherein the identifying the rule templatecomprises: identifying at least one first rule template including theindexed word, and which corresponds to the location of the identifiedindexed word among the plurality of prestored rule templates; andidentifying at least one second rule template of which slots are matchedby the at least one word excluding the indexed word among the pluralityof words included in the first text in the identified at least one firstrule template.